<div class="box-body">
    <form class="layui-form" action="{:url('/cha/sender/save')}" method="post">
        <div class="layui-form-item">
            <label class="layui-form-label xrequired">发件人</label>
            <div class="layui-input-block">
                <input type="text" autocomplete="off" placeholder=""  name="name" {if isset($sender)}value="{$sender.name}"{/if}  class="layui-input" />
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label xrequired">电话</label>
            <div class="layui-input-block">
                <input type="text" autocomplete="off" placeholder=""  name="phone" {if isset($sender)}value="{$sender.phone}"{/if}  class="layui-input" />
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label xrequired">手机</label>
            <div class="layui-input-block">
                <input type="text" autocomplete="off" placeholder=""  name="mobile" {if isset($sender)}value="{$sender.mobile}"{/if}  class="layui-input" />
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">邮箱</label>
            <div class="layui-input-block">
                <input type="text" autocomplete="off" placeholder=""  name="email" {if isset($sender)}value="{$sender.email}"{/if}  class="layui-input" />
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label xrequired">国家代码</label>
            <div class="layui-input-block">
                <select name="country_code">
                    <option value="CN">中国</option>
                    {foreach $countries as $c}
                    <option {if isset($sender) && $sender.country_code==$c.code_two}selected{/if} value="{$c.code_two}">{$c.name_ch}</option>
                    {/foreach}
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label xrequired">绑定账号</label>
            <div class="layui-input-block">
                <select name="account_id">
                    <option value="0">通用</option>
                    {foreach $account as $c}
                    <option {if isset($sender) && $sender.account_id==$c.account_id}selected{/if} value="{$c.account_id}">{$c.username}</option>
                    {/foreach}
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label xrequired">省份</label>
            <div class="layui-input-block">
                <input type="text" autocomplete="off" placeholder=""  name="province" {if isset($sender)}value="{$sender.province}"{/if}  class="layui-input" />
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label xrequired">城市</label>
            <div class="layui-input-block">
                <input type="text" autocomplete="off" placeholder=""  name="city" {if isset($sender)}value="{$sender.city}"{/if}  class="layui-input" />
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label xrequired">地址</label>
            <div class="layui-input-block">
                <input type="text" autocomplete="off" placeholder=""  name="address" {if isset($sender)}value="{$sender.address}"{/if}  class="layui-input" />
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">邮编</label>
            <div class="layui-input-block">
                <input type="text" autocomplete="off" placeholder=""  name="post_code" {if isset($sender)}value="{$sender.post_code}"{/if}  class="layui-input" />
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">状态</label>
            <div class="layui-input-block">
                <input type="checkbox" name="status" value="1" {if !isset($sender) || (isset($sender) && $sender.status)}checked{/if} lay-skin="switch">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">是否默认</label>
            <div class="layui-input-block">
                <input type="checkbox" name="is_default" value="1" {if isset($sender) && $sender.is_default}checked{/if} lay-skin="switch">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">备注</label>
            <div class="layui-input-block">
                <input type="text" autocomplete="off" placeholder=""  name="remark" {if isset($sender)}value="{$sender.remark}"{/if}  class="layui-input" />
            </div>
        </div>
        {if isset($sender)}
        <input type="hidden" name="sender_id" value="{$sender.sender_id}">
        {/if}
    </form>
</div>